package jp.co.lkg.springsmp.common;

import java.util.List;

import jp.co.lkg.springsmp.common.db.dto.FlowerinfoDto;
import jp.co.lkg.springsmp.common.db.dto.GoodinfoDto;
import jp.co.lkg.springsmp.common.db.dto.OrderinfoDto;
import jp.co.lkg.springsmp.common.db.dto.PrivateinfoDto;
import jp.co.lkg.springsmp.common.db.dto.UserinfoDto;

public class Page {
	private Integer currPage;
	private int totalSize;
	private int totalPage;
	private int minnumber;
	private int maxnumber;
	private List<GoodinfoDto>  datalist;
	private List<FlowerinfoDto> flowerlist;
	private List<OrderinfoDto> orderlist;
	private List<PrivateinfoDto> privatelist;
	private List<UserinfoDto> userlist ;
	
	public List<UserinfoDto> getUserlist() {
		return userlist;
	}
	public void setUserlist(List<UserinfoDto> userlist) {
		this.userlist = userlist;
	}
	public List<PrivateinfoDto> getPrivatelist() {
		return privatelist;
	}
	public void setPrivatelist(List<PrivateinfoDto> privatelist) {
		this.privatelist = privatelist;
	}
	public List<OrderinfoDto> getOrderlist() {
		return orderlist;
	}
	public void setOrderlist(List<OrderinfoDto> orderlist) {
		this.orderlist = orderlist;
	}
	public List<FlowerinfoDto> getFlowerlist() {
		return flowerlist;
	}
	public void setFlowerlist(List<FlowerinfoDto> flowerlist) {
		this.flowerlist = flowerlist;
	}
	public int page_size=4;

	public void initTotalPage(){
	if(totalSize%page_size==0){

	totalPage=totalSize/page_size;
	}else{
	totalPage =totalSize/page_size+1;
	} 
	}
	//需要注意的是最小值是当前页-1
	public void setMinnumber(Integer  currPage) {
	if(currPage==1){
	minnumber =0;
	}else{
	minnumber=(currPage-1)*page_size;
	}
	}

	public int getMinnumber() {
		return minnumber;
	}
	public int getMaxnumber() {
		return maxnumber;
	}

	public void setMaxnumber(Integer currPage) {
	if(currPage==1){
	maxnumber=page_size;
	}else{
	maxnumber =currPage*page_size;
	}
	}
	public Integer getCurrPage() {
		return currPage;
	}
	public void setCurrPage(Integer currPage) {
		this.currPage = currPage;
	}
	public int getTotalSize() {
		return totalSize;
	}
	public void setTotalSize(int totalSize) {
		this.totalSize = totalSize;
	}
	
	public List<GoodinfoDto> getDatalist() {
		return datalist;
	}
	public void setDatalist(List<GoodinfoDto> datalist) {
		this.datalist = datalist;
	}
	public int getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	
}

